<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTorneosVideoTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//
		Schema::create("torneos_videos", function($table){
				
			$table->increments('id');
			$table->string('url');
			$table->integer("torneo_id")->unsigned();
			$table->foreign("torneo_id")->references('id')->on('torneos')->onDelete('cascade');
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('torneos_videos', function($table)
		{
			$table->dropForeign('torneos_videos_torneo_id_foreign');
		});
		
		Schema::dropIfExists("torneos_videos");
	}

}
